<style>
    
    table,td,th {border:1px solid black;}
     table ,td {border-collapse: collapse;white-space: nowrap;}
     
     tr:even{background: gray;color:#fff}
</style>

<div class="line" style="overflow: auto;width: auto; min-height: 228px; ">
              <table id="Tabletopicos2">
                  <tr><td colspan="2"><h1>Disciplina: <?= utf8_decode($disciplina->DESCRICAO) ?></h1></td></tr>
                <tr>
                    <!--<th class="no-print"></th>-->
                    <th>T&oacute;picos</th>
                <?php
                if (!is_null($bibliografias_selecionadas)){
                    foreach ($bibliografias_selecionadas as $key => $value) {
                        echo "<th>".utf8_decode($value['DESCRICAO'])."</th>";
                    }
                }else{
                    echo "<th>Insdisponivel</th>";
                }
                /*

                 * $letters = array('a', 'p');
$fruit   = array('apple', 'pear');
$text    = 'a p';
$output  = str_replace($letters, $fruit, $text);                 */
                  
                ?>
                </tr>

                <?php 
              
                foreach ($topicos as $key => $topico) {
                  
                  echo "<tr>"
//                    . "<td style='text-align:center' class='no-print'><a class='excluirLinha' style='color:red'>X </a></td>"
                          . "<td>". utf8_decode($topico['DESCRICAO']) ."</td>";
                    if (!is_null($bibliografias_selecionadas)){ 
                  foreach ($bibliografias_selecionadas as $key => $value) { 
                     // print_r($value);
                        $N_pagina="";
                       if (isset($pagina[ $topico['CODIGO']] [$value['CODIGO']]->PAGINAS)){$N_pagina=$pagina[ $topico['CODIGO']] [$value['CODIGO']]->PAGINAS; } 
                       echo "<td>";
                       $N_pagina=  str_replace('-', " a ", $N_pagina);
                       echo "$N_pagina";
                      // echo "<input type='text' class='txtTopicos' name='PAGINAS[".$value['CODIGO']."][]' class='paginas'  value='".$N_pagina."'  placeholder='por exemplo, 1-5, 8, 11-13' >";
                            
                       echo "</td>";
                      }
                }
                   echo "</tr>";
                  }
                  
                ?>
              </table>
             
              
             
                
                
            </div>
